clc;
[x,y]=meshgrid(-3:0.1:2,-2:0.1:2);
z=(x.^2-2*x).*exp(-x.^2-y.^2-x.*y);
mesh(x,y,z);
%-------------------------------------------
figure()
surf(x,y,z);
%-------------------------------------------
figure()
waterfall(x,y,z);
title('waterfall()函数的绘制曲面')
%-------------------------------------------
figure()
contour3(x,y,z,40)
title('contour3()绘制的3维等高线图')
%-------------------------------------------
figure()
ezsurf('(x^2-2*x)*exp(-x^2-y^2-x*y)',[-3 3 -2 2])
%-------------------------------------------
figure()
ezcontour('(x^2-2*x)*exp(-x^2-y^2-x*y)',[-3 3 -2 2])